<%@ page import="java.net.URLEncoder" %><%--

  User: PING
  Date: 2022/9/7
  Time: 9:50
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%!
    public static boolean isEmpty(String input) {

        return input == null ||
                "".equals(input.trim());
    }

%>
<html>
<meta charset="UTF-8">
<head>
</head>
<body>
    <%
        // process the request from login UI
        request.setCharacterEncoding("UTF-8");
        String username = request.getParameter("username") ;
        String password = request.getParameter("password") ;
        String info = "" ;
        if (isEmpty(username) || isEmpty(password)) {
            response.sendRedirect("02_login.jsp?info=输入为空！");
        } else if ("123456".equals(password)) {
            request.getRequestDispatcher("03_welcome.jsp").forward(request,response);
        } else {
            String info1 = URLEncoder.encode("密码不正确", "UTF-8") ;
           response.sendRedirect("02_login.jsp?info=" + info1);
        }
    %>

</body>
</html>
